\documentclass[E:/GsjzTle/main/main.tex]{subfiles}


\begin{document}

\begin{lstlisting}
int far[N];
int find(int x)
{
	if(x == far[x]) return x;
	return far[x] = find(far[x]);
}
void Union(int x , int y)
{
	int tx = find(x) , ty = find(y);
	if(tx != ty) far[tx] = ty;
}
void init(int n)
{
	for(int i = 1 ; i <= n ; i ++) far[i] = i;
}
\end{lstlisting}

\end{document}
